package org.yaac.client.conf;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;

import com.google.gwt.activity.shared.ActivityManager;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.web.bindery.event.shared.EventBus;

/**
 * @author Max Zhu (thebbsky@gmail.com)
 *
 */
public class MainActivityManagerProvider implements Provider<ActivityManager> {

	private final ActivityMapper activityMapper;
	
	private final EventBus eventBus;
	
	/**
	 * @param activityMapper
	 * @param eventBus
	 */
	@Inject
	MainActivityManagerProvider(
			@Named(BindingConstants.MAIN_ACTIVITY_MAPPER) ActivityMapper activityMapper, 
			EventBus eventBus) {
		super();
		this.activityMapper = activityMapper;
		this.eventBus = eventBus;
	}

	@Override
	public ActivityManager get() {
		return new ActivityManager(activityMapper, eventBus);
	}
}
